package com.authine.cloudpivot.ext.vo;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 申请退款VO
 *
 * @author update 张磊
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("申请退款VO")
public class ApplyRefundVo implements Serializable {

    private static final long serialVersionUID = -7659625580424989232L;
    @ApiModelProperty(value = "订单商品ID", required = true, position = 1)
    private String orderGoodsId;
    @ApiModelProperty(value = "数量", required = true, position = 2)
    private BigDecimal num;
    @ApiModelProperty(value = "备注", required = true, position = 3)
    private String memo;
    @ApiModelProperty(value = "平台是否同意", position = 4)
    private Boolean platform;

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        String ObjectToJson = "";
        try {
            ObjectToJson = objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return ObjectToJson;

    }
}
